Skip to content

feat(AIC-3449): refactor AI Config reference into a dataclass - #113

Merged
aknight-ld merged 1 commit into
mainfrom
AIC-3449-refine-config-defs
Sep 28, 2026
Merged

aknight-ld merged 1 commit into
mainfrom
AIC-3449-refine-config-defs

Conversation

@aknight-ld

@aknight-ld aknight-ld commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Making the relationship between config and variation keys explicit for easier validation. No functional changes beyond this minor refactor.


Note

Overview
Breaking API change: EvaluationsModule.run() no longer accepts separate ai_config and variation string arguments. Callers must pass a single AIConfig(key=..., variation=...) frozen dataclass when seeding a run from an existing AI Config variation.

The new type is exported from launchdarkly_ai_server and launchdarkly_ai_server.evaluations. Validation now checks ai_config.key and ai_config.variation for blank values (replacing the old paired-parameter errors). Fetching, merging with generation, tools, judges, and logging behavior are unchanged aside from using the struct’s fields.

Reviewed by Cursor Bugbot for commit 2bb40bb. Bugbot is set up for automated code reviews on this repo. Configure here.

@aknight-ld
aknight-ld requested a review from donei003 September 25, 2026 19:13

@donei003 donei003 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just had a commenting regarding the ability to re-use a dataclass if one exists.



@dataclass(frozen=True)
class AIConfig:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have ways to evaluate an AI Config in the SDK already. Is there anywhere in the SDK that returns an AI Config object? If so, we should re-use that class if possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

none that I could find in searching. if we move forward with the proposed UX changes we can refine/consolidate

@aknight-ld
aknight-ld merged commit 3ac06b4 into main Sep 28, 2026
8 checks passed
@aknight-ld
aknight-ld deleted the AIC-3449-refine-config-defs branch September 28, 2026 15:23
@github-actions github-actions Bot mentioned this pull request Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants